/**
 * 
 */
package neptune.web.client.commands;

import neptune.web.client.view.ClusterView;
import neptune.web.client.view.HistoryTokenUtils;
import neptune.web.client.view.OperativeView;
import neptune.web.client.view.SuperView;
import neptune.web.client.view.ViewManager;

import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.History;

/**
 * @author Roberto Bifulco [RobertoBifulco.it] [info@robertoBifulco.it]
 *
 */
public class OpenClusterViewCommand implements Command {

	/* (non-Javadoc)
	 * @see com.google.gwt.user.client.Command#execute()
	 */
	public void execute() {
		SuperView operative = (SuperView) ViewManager.getViewManager().getViewByName(
				OperativeView.DEFAULT_TOKEN);
		
		ClusterView cluster = (ClusterView) operative.getViewByName(ClusterView.DEFAULT_TOKEN);
		cluster.refreshData();
		
		History.newItem(HistoryTokenUtils.buildToken(OperativeView.DEFAULT_TOKEN,
		ClusterView.DEFAULT_TOKEN));

	}

}
